public class Excise4 {

    public static void main(String[] args) {
    int num = 0;
    int j=0;
    int i = 0;
        for (num=2;num<=100;num++) 
        {
                for(i=2;i<=num;i++)
                {
                        if((num%i)==0)
                        {
                            break;
                        }
                }
        
                if(i>(num/2)) 
                {
                System.out.print(num);
                System.out.print(" ");
                }
         }
         System.out.println(" "); 
                    for (num=2;j<100;num++) 
                     {
                            for(i=2;i<=num;i++)
                            {
                                    if((num%i)==0)
                                    {
                                        break;
                                    }
                            }
                    
                            if(i>(num/2)) 
                            {
                            System.out.print(num);
                            System.out.print(" ");
                            j++;
                            }
                        }
                    
    }
    }